import { defineStore } from "pinia"
import { computed, ref } from 'vue'
import { useUserStore } from "./userStore"
export const useCartStore = defineStore('cart', () => {
    const userStore = useUserStore()
    const isLogin = computed(() => userStore.userInfo.token)
    // 购物车的 state
    const cartList = ref<any[] | null>([])
    // 购物车的 state

    // 购物车的 mutations
    const updateNewList = () => {

    }
    const clearCart = () => {
        cartList.value = []
    }

    return {
        cartList,
        updateNewList,
        clearCart
    }
})